package com.xmx.util;

import cn.hutool.crypto.digest.DigestAlgorithm;
import cn.hutool.crypto.digest.Digester;

public class SHA256 {
    public static String SHA256(String testStr) {
        Digester SHA256 = new Digester(DigestAlgorithm.SHA256);
        String digestHex = SHA256.digestHex(testStr);
        return digestHex;
    }

    //SHA256加密
    public static void main(String[] args) {
        System.out.println(SHA256("123456"));
    }
}

